﻿using IServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using YL.Utils.Extensions;

namespace Method.SmartMeter.ViewComponents
{
    public class ClientInfoViewComponent : ViewComponent
    {
        private readonly IMeter_ClientInfoServices meter_ClientInfoServices;

        public ClientInfoViewComponent(IMeter_ClientInfoServices clientInfoServices)
        {
            meter_ClientInfoServices = clientInfoServices;
        }

        public async Task<IViewComponentResult> InvokeAsync()
        {
            var dept = await meter_ClientInfoServices.QueryableToList(c => c.ClientId >0).ToListAsync();
            return View(dept);
        }
    }
}